<#macro webfrontpage >
  <#local actionUrl = "/cms?p=" + p >
  <#local currentPage = page.currentPageNo >
  <#local totalPage   = page.totalPages > 
  <#if (totalPage <= 0) || (currentPage > totalPage)><#return></#if>
	<#local startPage = currentPage - 4>
	<#if (startPage < 1)><#local startPage = 1></#if>
	<#local endPage = currentPage + 4>
	<#if (endPage > totalPage)><#local endPage = totalPage></#if>
 	<div style="height:30px; line-height:30px;">
		<div style=" float: left;   margin-left: 30px;">
		共${page.totalRows}条，共${page.totalPages}页
		</div>
		<div style="float:right; margin-right:30px;">
			<#if (currentPage <= 8)><#local startPage = 1></#if>
			<#if ((totalPage - currentPage) < 8)><#local endPage = totalPage></#if>
			
			<#if (currentPage == 1)>
				<a href="#" style="disabled:true;">上一页</a> 
			<#else>
				<#local prevPageNo = actionUrl + "&page=" + (currentPage - 1)>
				<a href="${prevPageNo}" >上一页</a>
			</#if>
			<#if (currentPage > 8)>
				<#local numberPageNo = actionUrl + "&page=" + 1 >
				<a href="${numberPageNo}" >#{1}</a>
				<#local numberPageNo = actionUrl + "&page=" + 2 >
				<a href="${numberPageNo}" >#{2}</a>
				<span class="gap">…</span>
			</#if>
			
			<#list startPage..endPage as i>
				<#if currentPage == i>
					<span class="current">#{i}</span>
				<#else>
					<#local numberPage = actionUrl + "&page=" + i >
					<a href="${numberPage}">#{i}</a>
				</#if>
			</#list>
			<#if ((totalPage - currentPage) >= 8)>
				<span class="gap">…</span>
				<#local numberPageNo = actionUrl + "&page=" + (totalPage - 1) >
				<a href="${numberPageNo}" >#{totalPage - 1}</a>
				<#local numberPageNo = actionUrl + "&page=" + totalPage >
				<a href="${numberPageNo}" >#{totalPage}</a>
			</#if>
			
			<#if (currentPage == totalPage)>
				<a href="#" style="disabled:true;">下一页</a>
			<#else>
				<#local nextPageNo = actionUrl + "&page=" + (currentPage + 1)>
				<a href="${nextPageNo}" >下一页</a>
			</#if>
		</div>
		<div style="clear:both;"></div>
     </div>
</#macro>